var app = getApp();
Page({
  
  data: {
      slider: [
      {picUrl: '../../images/p1.png'},
      {picUrl: '../../images/p2.png'},
      {picUrl: '../../images/p3.png'},
      ],
      swiperCurrent: 0,
      
  },
  swiperChange: function(e){
      this.setData({
          swiperCurrent: e.detail.current
      })
  },
  onGetOpenid: function() {
    // 调用云函数
    wx.cloud.callFunction({
      name: 'login',
      data: {},
      success: res => {
        console.log('[云函数] [login] user openid: ', res.result.openid)
        app.globalData.openid = res.result.openid
      },
      fail: err => {
        console.error('[云函数] [login] 调用失败', err)
      }
    })
  },
go:function(){
  if(this.data.swiperCurrent==0){  
    wx.navigateTo({
      url: '../mail/mail',
    })
  }
  else if(this.data.swiperCurrent==1){
    wx.navigateTo({
      url: '../tougao/tougao',
    })
  }
  else{  
    wx.navigateTo({
      url: '../about/about',
    })
  }
},
goto:function(){
  wx.navigateTo({
    url: '../mail/mail',
  })
},
goin:function(){
  wx.navigateTo({
    url: '../detail/detail',
  })
},
onLoad: function () {
  this.onGetOpenid()
   
},
  })